package com.superm.service.impl;

import com.superm.mappers.PurchaseDetailsMapper;
import com.superm.service.PurshaseDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class PurshaseDetailsServiceImpl implements PurshaseDetailsService {


    @Autowired
    private PurchaseDetailsMapper purchaseDetailsMapper;
    /**
     * 查询订单下的订单信息
     * @param purCode
     * @return
     */
    @Override
    public Map<String, Object> selectPurCodeDetails(String purCode,Integer pageNo,Integer pageSize) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("code",0);
        //查条数
        map.put("count",purchaseDetailsMapper.count(purCode));
        map.put("data",purchaseDetailsMapper.selectCodeMation(purCode,(pageNo-1)*pageSize,pageSize));
        return map;
    }
}
